import BaseEntity from './BaseEntity.mjs'

/**
 * 站点作者
 */
export default class SiteAuthor extends BaseEntity {
  /**
   * 作者来源站点id
   * @type { number | undefined | null }
   */
  siteId
  /**
   * 站点中作者的id
   * @type { string | undefined | null }
   */
  siteAuthorId
  /**
   * 站点中作者的名称
   * @type { string | undefined | null }
   */
  authorName
  /**
   * 站点中作者的固定名称（不会改变，比如账号）
   * @type { string | undefined | null }
   */
  fixedAuthorName
  /**
   * 站点中作者的曾用名
   * @type { string[] | string | undefined | null }
   */
  siteAuthorNameBefore
  /**
   * 介绍
   * @type { string | undefined | null }
   */
  introduce
  /**
   * 站点作者在本地对应的作者id
   * @type { number | undefined | null }
   */
  localAuthorId
  /**
   * 最后一次使用的时间
   * @type { number | null | undefined }
   */
  lastUse

  constructor(siteAuthor) {
    super(siteAuthor)
    if (siteAuthor === undefined) {
      this.siteId = undefined
      this.siteAuthorId = undefined
      this.authorName = undefined
      this.fixedAuthorName = undefined
      this.siteAuthorNameBefore = undefined
      this.introduce = undefined
      this.localAuthorId = undefined
      this.lastUse = undefined
    } else {
      this.siteId = siteAuthor.siteId
      this.siteAuthorId = siteAuthor.siteAuthorId
      this.authorName = siteAuthor.authorName
      this.fixedAuthorName = siteAuthor.fixedAuthorName
      this.siteAuthorNameBefore = siteAuthor.siteAuthorNameBefore
      this.introduce = siteAuthor.introduce
      this.localAuthorId = siteAuthor.localAuthorId
      this.lastUse = siteAuthor.lastUse
    }
  }
}
